#include<stdio.h>
#include<stdlib.h>
#include<filesystem>
using namespace std;
typedef struct student{
    int id;
    char name[10];
    int age;
    struct student *next;
}*stu;
void pr(stu s){
    printf("%d %s %d",s->id,s->name,s->age);
}
void readFile(){
    stu head=NULL;
    stu p;
    FILE *fr=fopen("./c.txt","rb");
    while(!feof(fr)){
        stu s=(stu)malloc(sizeof(struct student));
        s->next=NULL;
        if(head==NULL){
            fscanf(fr,"%d %s %d",&s->id,&s->name,&s->age);
            head=s;
            p=head;
        }else{
            fscanf(fr,"%d %s %d",&s->id,&s->name,&s->age);
            while(p->next) p=p->next;
            p->next=s;
        }
    }
    fclose(fr);
    pr(head);
}
int main(){
    readFile();
    return 0;
}